<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>通知管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {

        });

        function page(n, s) {
            $("#pageCurrent").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/sys/sysNotify/">通知列表</a></li>
    <shiro:hasPermission name="sys:sysNotify:edit">
        <li><a href="${ctx}/sys/sysNotify/form">通知添加</a></li>
    </shiro:hasPermission>
</ul>
<form:form id="searchForm" modelAttribute="sysNotify" action="${ctx}/sys/sysNotify/" method="post" class="breadcrumb form-search">
    <input id="pageCurrent" name="pageCurrent" type="hidden" value="${page.current}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.size}"/>
    <ul class="ul-form">
        <li><label>标题：</label>
            <form:input path="title" htmlEscape="false" maxlength="200" class="input-medium"/>
        </li>
        <li><label>类型：</label>
            <form:select path="type" class="input-medium">
                <form:option value="" label=""/>
                <form:options items="${fns:getDataDictItemList('sys_notify_type')}" itemLabel="itemName" itemValue="itemCode" htmlEscape="false"/>
            </form:select>
        </li>
        <li><label>状态：</label>
            <form:radiobuttons path="status" items="${fns:getDataDictItemList('sys_notify_status')}" itemLabel="itemName" itemValue="itemCode" htmlEscape="false"/>
        </li>
        <li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
        <li class="clearfix"></li>
    </ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>标题</th>
        <th>类型</th>
        <th>状态</th>
        <th>查阅状态</th>
        <th>更新时间</th>
        <shiro:hasPermission name="sys:sysNotify:edit">
            <th>操作</th>
        </shiro:hasPermission>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${page.records}" var="sysNotify">
        <tr>
            <td><a href="${ctx}/sys/sysNotify/form?id=${sysNotify.id}"> ${fns:abbr(sysNotify.title,50)} </a></td>
            <td> ${fns:getDataDictValue('sys_notify_type',sysNotify.type)} </td>
            <td> ${fns:getDataDictValue('sys_notify_status',sysNotify.status)} </td>
            <td> ${sysNotify.readNum} / ${sysNotify.readNum + sysNotify.unReadNum} </td>
            <td><fmt:formatDate value="${sysNotify.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
            <shiro:hasPermission name="sys:sysNotify:edit">
                <td>
                    <a href="${ctx}/sys/sysNotify/form?id=${sysNotify.id}">修改</a>
                    <a href="${ctx}/sys/sysNotify/delete?id=${sysNotify.id}" onclick="return confirmx('确认要删除该通知吗？', this.href)">删除</a>
                </td>
            </shiro:hasPermission>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>